#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main() {
    double a = 0.0;
    int b = 0;
    scanf("%lf", &a);
    b = (int)(a) % 10;
    printf("%d", b);
    return 0;
}